var vm_sidebar = new Vue({
  el: ".side_bar",
  delimiters: ["[[", "]]"],
  data: {
    active_tab_num: 0,
  },
  created() {
    window.addEventListener("resize", this.myEventHandler, false);
  },
  destroyed() {
    window.removeEventListener("resize", this.myEventHandler, false);
  },
  mounted() {
    let t = window.location.pathname;
    if (t == "/dw/") {
      this.active_tab_num = 1;
    } else if (t == "/tutorial/spd-noise/") {
      this.active_tab_num = 2;
    } else if (t == "/file/") {
      this.active_tab_num = 3;
    } else if (t == "/tutorial/ra-install/") {
      this.active_tab_num = 4;
    } else if (t == "/tutorial/") {
      this.active_tab_num = 5;
    } else if (t == "/tutorial/tma/") {
      this.active_tab_num = 6;
    } else if (t == "/tutorial/tma-demo/") {
      this.active_tab_num = 7;
    } else if (t == "/tutorial/tma-caculate/") {
      this.active_tab_num = 8;
    } else if (t == "/tutorial/broadband/") {
      this.active_tab_num = 9;
    } else if (t == "/tutorial/uuv-setup/") {
      this.active_tab_num = 10;
    } else if (t == "/tutorial/torpeto-setup/") {
      this.active_tab_num = 11;
    } else if (t == "/tutorial/buoy/") {
      this.active_tab_num = 12;
    } else if (t == "/tutorial/subroc-setting/") {
      this.active_tab_num = 13;
    } else if (t == "/tutorial/shkval-setting/") {
      this.active_tab_num = 14;
    } else if (t == "/tutorial/cm-setting/") {
      this.active_tab_num = 15;
    } else if (t == "/tutorial/decoy-setting/") {
      this.active_tab_num = 16;
    } else if (t == "/tutorial/multi-players/") {
      this.active_tab_num = 17;
    } else {
      this.active_tab_num = 999;
    }
    // console.log('-----------------------------------------')
    // console.log(t);
    // console.log(this.active_tab_num)
    // console.log('-----------------------------------------')
  },
  methods: {
    handle_click_tab(num) {
      console.log("click");
      this.active_tab_num = num;
    },
    // myEventHandler(e) {
    //  this.myChart.resize();
    // },
    async axiosGet(url, params) {
      try {
        const response = await axios.get(url, { params });
        return response.data;
      } catch (err) {
        console.log(err.response.status);
      }
    },
  },
  watch: {},
});
